package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.IotGatewayMapper;
import com.ruoyi.system.domain.IotGateway;
import com.ruoyi.system.service.IIotGatewayService;

/**
 * 物联网关信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-03-27
 */
@Service
public class IotGatewayServiceImpl implements IIotGatewayService 
{
    @Autowired
    private IotGatewayMapper iotGatewayMapper;

    /**
     * 查询物联网关信息
     * 
     * @param id 物联网关信息主键
     * @return 物联网关信息
     */
    @Override
    public IotGateway selectIotGatewayById(Long id)
    {
        return iotGatewayMapper.selectIotGatewayById(id);
    }

    /**
     * 查询物联网关信息列表
     * 
     * @param iotGateway 物联网关信息
     * @return 物联网关信息
     */
    @Override
    public List<IotGateway> selectIotGatewayList(IotGateway iotGateway)
    {
        return iotGatewayMapper.selectIotGatewayList(iotGateway);
    }

    /**
     * 新增物联网关信息
     * 
     * @param iotGateway 物联网关信息
     * @return 结果
     */
    @Override
    public int insertIotGateway(IotGateway iotGateway)
    {
        iotGateway.setCreateTime(DateUtils.getNowDate());
        return iotGatewayMapper.insertIotGateway(iotGateway);
    }

    /**
     * 修改物联网关信息
     * 
     * @param iotGateway 物联网关信息
     * @return 结果
     */
    @Override
    public int updateIotGateway(IotGateway iotGateway)
    {
        return iotGatewayMapper.updateIotGateway(iotGateway);
    }

    /**
     * 批量删除物联网关信息
     * 
     * @param ids 需要删除的物联网关信息主键
     * @return 结果
     */
    @Override
    public int deleteIotGatewayByIds(Long[] ids)
    {
        return iotGatewayMapper.deleteIotGatewayByIds(ids);
    }

    /**
     * 删除物联网关信息信息
     * 
     * @param id 物联网关信息主键
     * @return 结果
     */
    @Override
    public int deleteIotGatewayById(Long id)
    {
        return iotGatewayMapper.deleteIotGatewayById(id);
    }
}
